home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 413_01 / sndblst4 / rawin.c < prev    next >
Text File  |  1993-12-10  |  1KB  |  48 lines

  1.  
  2. //------------------------------------------------------------------------------
  3. // Copyright (c) David Welch, 1993
  4. //------------------------------------------------------------------------------
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include <string.h>
  8.  
  9. #include "sb.h"
  10. unsigned char ca;
  11. unsigned short ra;
  12. unsigned long la;
  13. FILE *fp;
  14. unsigned char gstring[80];
  15. unsigned long dLen;
  16. //------------------------------------------------------------------------------
  17. void main ( int argc, char *argv[] )
  18. {
  19.     if(argc<3)
  20.     {
  21.         printf("RAWIN [d:][path]filename[.ext] samplerate\n");
  22.         exit(1);
  23.     }
  24.     if((fp=fopen(argv[1],"wb"))==0)
  25.     {
  26.         printf("Error creating file [%s]\n",argv[1]);
  27.         exit(1);
  28.     }
  29.     printf("FILE: [%s]\n",argv[1]);
  30.     sbinit();
  31.     sbmalloc();
  32.     ra=atoi(argv[2]);
  33.     printf("Samples Per Second %u\n",ra);
  34.     ca=256UL-(1000000UL/ra);
  35.     printf("Time Constant %u\n",ca);
  36.     sbsettc(ca);
  37.     sbrec(65000);
  38.     printf("Recording 65000 samples\n");
  39. //  while(dmacount()!=0xFFFF);
  40.     dmastatus();
  41.     while(!dmastatus()) continue;
  42.     fwrite(aligned,1,65000,fp);
  43. }
  44. //------------------------------------------------------------------------------
  45. // Copyright (c) David Welch, 1993
  46. //------------------------------------------------------------------------------
  47.  
  48.